<!doctype html>
<html lang="zh-CN">
<head>

    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    
    <meta name="referrer" content="no-referrer-when-downgrade">
    

    <title>Pysimplegui_calendar | Java专家随笔记</title>
    <meta property="og:title" content="Pysimplegui_calendar - Java专家随笔记">
    <meta property="og:type" content="article">
        
    <meta property="article:published_time" content='2021-11-30T10:05:10&#43;08:00'>
        
        
    <meta property="article:modified_time" content='2021-11-30T10:05:10&#43;08:00'>
        
    <meta name="Keywords" content="Java,算法......其他以后再加">
    <meta name="description" content="Pysimplegui_calendar">
        
    <meta name="author" content="gwozai">
    <meta property="og:url" content="https://gwozai.gitee.io/post/pysimplegui_calendar/">
    <link rel="shortcut icon" href='/favicon.ico'  type="image/x-icon">

    <link rel="stylesheet" href='/css/normalize.css'>
    <link rel="stylesheet" href='/css/style.css'>
    <script type="text/javascript" src="//cdn.bootcdn.net/ajax/libs/jquery/3.4.1/jquery.min.js"></script>

    
    
    
        <link href="https://cdn.bootcdn.net/ajax/libs/fancybox/3.5.7/jquery.fancybox.min.css" rel="stylesheet">
    
    
    
    
        <link rel="stylesheet" href='/css/douban.css'>
    
        <link rel="stylesheet" href='/css/other.css'>
    
</head>


<body>
    <header id="header" class="clearfix">
    <div class="container">
        <div class="col-group">
            <div class="site-name ">
                
                    <a id="logo" href="https://gwozai.gitee.io/">
                        Java专家随笔记
                    </a>
                
                <p class="description">一切有为法，如梦幻泡影，如露亦如电，应作如是观</p>
            </div>
            <div>
                <nav id="nav-menu" class="clearfix">
                    <a class="current" href="https://gwozai.gitee.io/">首页</a>
                    
                    <a  href="https://gwozai.gitee.io/tools/" title="工具">工具</a>
                    
                    <a  href="https://gwozai.gitee.io/archives/" title="归档">归档</a>
                    
                    <a  href="https://gwozai.gitee.io/about/" title="关于">关于</a>
                    
                </nav>
            </div>
        </div>
    </div>
</header>

    <div id="body">
        <div class="container">
            <div class="col-group">

                <div class="col-8" id="main">
                    
<div class="res-cons">
    <style type="text/css">
    .post-toc {
        position: fixed;
        width: 200px;
        margin-left: -210px;
        padding: 5px 10px;
        font-family: Athelas, STHeiti, Microsoft Yahei, serif;
        font-size: 12px;
        border: 1px solid rgba(0, 0, 0, .07);
        border-radius: 5px;
        background-color: rgba(255, 255, 255, 0.98);
        background-clip: padding-box;
        -webkit-box-shadow: 1px 1px 2px rgba(0, 0, 0, .125);
        box-shadow: 1px 1px 2px rgba(0, 0, 0, .125);
        word-wrap: break-word;
        white-space: nowrap;
        -webkit-box-sizing: border-box;
        box-sizing: border-box;
        z-index: 999;
        cursor: pointer;
        max-height: 70%;
        overflow-y: auto;
        overflow-x: hidden;
    }

    .post-toc .post-toc-title {
        width: 100%;
        margin: 0 auto;
        font-size: 20px;
        font-weight: 400;
        text-transform: uppercase;
        text-align: center;
    }

    .post-toc .post-toc-content {
        font-size: 15px;
    }

    .post-toc .post-toc-content>nav>ul {
        margin: 10px 0;
    }

    .post-toc .post-toc-content ul {
        padding-left: 20px;
        list-style: square;
        margin: 0.5em;
        line-height: 1.8em;
    }

    .post-toc .post-toc-content ul ul {
        padding-left: 15px;
        display: none;
    }

    @media print,
    screen and (max-width:1057px) {
        .post-toc {
            display: none;
        }
    }
</style>
<div class="post-toc" style="position: absolute; top: 188px;">
    <h2 class="post-toc-title">文章目录</h2>
    <div class="post-toc-content">
        <nav id="TableOfContents">
  <ul>
    <li><a href="#日历选择">日历选择</a></li>
    <li><a href="#收集这些按钮-写成自己的文档">收集这些按钮 写成自己的文档</a></li>
  </ul>
</nav>
    </div>
</div>
<script type="text/javascript">
    $(document).ready(function () {
        var postToc = $(".post-toc");
        if (postToc.length) {
            var leftPos = $("#main").offset().left;
            if(leftPos<220){
                postToc.css({"width":leftPos-10,"margin-left":(0-leftPos)})
            }

            var t = postToc.offset().top - 20,
                a = {
                    start: {
                        position: "absolute",
                        top: t
                    },
                    process: {
                        position: "fixed",
                        top: 20
                    },
                };
            $(window).scroll(function () {
                var e = $(window).scrollTop();
                e < t ? postToc.css(a.start) : postToc.css(a.process)
            })
        }
    })
</script>
    <article class="post">
        <header>
            <h1 class="post-title">Pysimplegui_calendar</h1>
        </header>
        <date class="post-meta meta-date">
            2021年11月30日
        </date>
        
        <div class="post-meta">
            <span>|</span>
            
            <span class="meta-category"><a href='/categories/PySimpleGUi'>PySimpleGUi</a></span>
            
        </div>
        
        
        <div class="post-meta">
            <span id="busuanzi_container_page_pv">|<span id="busuanzi_value_page_pv"></span><span>
                    阅读</span></span>
        </div>
        
        
        <div class="clear" style="display: none">
            <div class="toc-article">
                <div class="toc-title">文章目录</div>
            </div>
        </div>
        
        <div class="post-content">
            <p>背景添加，有bug不中用</p>
<p><a href="https://blog.csdn.net/qq_37828873/article/details/114636757">(17条消息) 用户交互界面&mdash;python-PySimpleGUI库_小白我超可爱的的博客-CSDN博客_python 交互界面</a></p>
<h2 id="日历选择">日历选择</h2>
<div class="highlight"><div style="background-color:#fff;-moz-tab-size:4;-o-tab-size:4;tab-size:4">
<table style="border-spacing:0;padding:0;margin:0;border:0;width:auto;overflow:auto;display:block;"><tr><td style="vertical-align:top;padding:0;margin:0;border:0;">
<pre style="background-color:#fff;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code><span style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">  1
</span><span style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">  2
</span><span style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">  3
</span><span style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">  4
</span><span style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">  5
</span><span style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">  6
</span><span style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">  7
</span><span style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">  8
</span><span style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">  9
</span><span style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 10
</span><span style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 11
</span><span style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 12
</span><span style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 13
</span><span style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 14
</span><span style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 15
</span><span style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 16
</span><span style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 17
</span><span style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 18
</span><span style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 19
</span><span style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 20
</span><span style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 21
</span><span style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 22
</span><span style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 23
</span><span style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 24
</span><span style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 25
</span><span style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 26
</span><span style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 27
</span><span style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 28
</span><span style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 29
</span><span style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 30
</span><span style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 31
</span><span style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 32
</span><span style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 33
</span><span style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 34
</span><span style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 35
</span><span style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 36
</span><span style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 37
</span><span style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 38
</span><span style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 39
</span><span style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 40
</span><span style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 41
</span><span style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 42
</span><span style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 43
</span><span style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 44
</span><span style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 45
</span><span style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 46
</span><span style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 47
</span><span style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 48
</span><span style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 49
</span><span style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 50
</span><span style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 51
</span><span style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 52
</span><span style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 53
</span><span style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 54
</span><span style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 55
</span><span style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 56
</span><span style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 57
</span><span style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 58
</span><span style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 59
</span><span style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 60
</span><span style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 61
</span><span style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 62
</span><span style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 63
</span><span style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 64
</span><span style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 65
</span><span style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 66
</span><span style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 67
</span><span style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 68
</span><span style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 69
</span><span style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 70
</span><span style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 71
</span><span style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 72
</span><span style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 73
</span><span style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 74
</span><span style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 75
</span><span style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 76
</span><span style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 77
</span><span style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 78
</span><span style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 79
</span><span style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 80
</span><span style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 81
</span><span style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 82
</span><span style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 83
</span><span style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 84
</span><span style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 85
</span><span style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 86
</span><span style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 87
</span><span style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 88
</span><span style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 89
</span><span style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 90
</span><span style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 91
</span><span style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 92
</span><span style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 93
</span><span style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 94
</span><span style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 95
</span><span style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 96
</span><span style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 97
</span><span style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 98
</span><span style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 99
</span><span style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">100
</span><span style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">101
</span><span style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">102
</span><span style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">103
</span><span style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">104
</span><span style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">105
</span><span style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">106
</span><span style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">107
</span><span style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">108
</span><span style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">109
</span><span style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">110
</span><span style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">111
</span><span style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">112
</span><span style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">113
</span><span style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">114
</span><span style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">115
</span><span style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">116
</span><span style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">117
</span><span style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">118
</span><span style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">119
</span><span style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">120
</span><span style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">121
</span><span style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">122
</span><span style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">123
</span><span style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">124
</span><span style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">125
</span><span style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">126
</span><span style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">127
</span><span style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">128
</span><span style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">129
</span><span style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">130
</span><span style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">131
</span><span style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">132
</span><span style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">133
</span><span style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">134
</span><span style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">135
</span><span style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">136
</span><span style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">137
</span><span style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">138
</span><span style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">139
</span><span style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">140
</span><span style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">141
</span><span style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">142
</span><span style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">143
</span><span style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">144
</span><span style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">145
</span><span style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">146
</span><span style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">147
</span><span style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">148
</span><span style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">149
</span><span style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">150
</span><span style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">151
</span><span style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">152
</span><span style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">153
</span><span style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">154
</span><span style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">155
</span><span style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">156
</span><span style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">157
</span><span style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">158
</span><span style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">159
</span><span style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">160
</span><span style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">161
</span><span style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">162
</span><span style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">163
</span><span style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">164
</span></code></pre></td>
<td style="vertical-align:top;padding:0;margin:0;border:0;;width:100%">
<pre style="background-color:#fff;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-python" data-lang="python"><span style="color:#000;font-weight:bold">import</span> <span style="color:#555">PySimpleGUI</span> <span style="color:#000;font-weight:bold">as</span> <span style="color:#555">sg</span>
<span style="color:#000;font-weight:bold">import</span> <span style="color:#555">datetime</span>
<span style="color:#000;font-weight:bold">import</span> <span style="color:#555">calendar</span>
<span style="color:#000;font-weight:bold">import</span> <span style="color:#555">itertools</span>

<span style="color:#d14">&#34;&#34;&#34;
</span><span style="color:#d14">    Demo_Date_Chooser
</span><span style="color:#d14">    
</span><span style="color:#d14">    This is the same code that is now used internally in PySimpleGUI as the &#39;date chooser&#39;
</span><span style="color:#d14">    It is shown here in a demo program form to demonstrate to you that PySimpleGUI is being used
</span><span style="color:#d14">    to implement user features.  The underlying GUI framework is no longer being used like it was previously
</span><span style="color:#d14">    
</span><span style="color:#d14">    Copyright 2020 PySimpleGUI
</span><span style="color:#d14">&#34;&#34;&#34;</span>


<span style="color:#000;font-weight:bold">def</span> <span style="color:#900;font-weight:bold">popup_get_date</span>(start_mon<span style="color:#000;font-weight:bold">=</span><span style="color:#999">None</span>, start_day<span style="color:#000;font-weight:bold">=</span><span style="color:#999">None</span>, start_year<span style="color:#000;font-weight:bold">=</span><span style="color:#999">None</span>, begin_at_sunday_plus<span style="color:#000;font-weight:bold">=</span><span style="color:#099">0</span>, no_titlebar<span style="color:#000;font-weight:bold">=</span><span style="color:#999">True</span>, title<span style="color:#000;font-weight:bold">=</span><span style="color:#d14">&#39;Choose Date&#39;</span>, keep_on_top<span style="color:#000;font-weight:bold">=</span><span style="color:#999">True</span>, location<span style="color:#000;font-weight:bold">=</span>(<span style="color:#999">None</span>, <span style="color:#999">None</span>), close_when_chosen<span style="color:#000;font-weight:bold">=</span><span style="color:#999">False</span>, icon<span style="color:#000;font-weight:bold">=</span><span style="color:#999">None</span>, locale<span style="color:#000;font-weight:bold">=</span><span style="color:#999">None</span>, month_names<span style="color:#000;font-weight:bold">=</span><span style="color:#999">None</span>, day_abbreviations<span style="color:#000;font-weight:bold">=</span><span style="color:#999">None</span>):
    <span style="color:#d14">&#34;&#34;&#34;
</span><span style="color:#d14">    Display a calendar window, get the user&#39;s choice, return as a tuple (mon, day, year)
</span><span style="color:#d14">
</span><span style="color:#d14">    :param start_mon: The starting month
</span><span style="color:#d14">    :type start_mon: int
</span><span style="color:#d14">    :param start_day: The starting day - optional. Set to None or 0 if no date to be chosen at start
</span><span style="color:#d14">    :type start_day: int or None
</span><span style="color:#d14">    :param start_year: The starting year
</span><span style="color:#d14">    :type start_year: int
</span><span style="color:#d14">    :param begin_at_sunday_plus: Determines the left-most day in the display. 0=sunday, 1=monday, etc
</span><span style="color:#d14">    :type begin_at_sunday_plus: int
</span><span style="color:#d14">    :param icon: Same as Window icon parameter. Can be either a filename or Base64 value. For Windows if filename, it MUST be ICO format. For Linux, must NOT be ICO
</span><span style="color:#d14">    :type icon: str
</span><span style="color:#d14">    :param locale: locale used to get the day names
</span><span style="color:#d14">    :type locale: str
</span><span style="color:#d14">    :param month_names: optional list of month names to use (should be 12 items)
</span><span style="color:#d14">    :type month_names: List[str]
</span><span style="color:#d14">    :param day_abbreviations: optional list of abbreviations to display as the day of week
</span><span style="color:#d14">    :type day_abbreviations: List[str]
</span><span style="color:#d14">    :return: Tuple containing (month, day, year) of chosen date or None if was cancelled
</span><span style="color:#d14">    :rtype: None or (int, int, int)
</span><span style="color:#d14">    &#34;&#34;&#34;</span>

    <span style="color:#000;font-weight:bold">if</span> month_names <span style="color:#000;font-weight:bold">is</span> <span style="color:#000;font-weight:bold">not</span> <span style="color:#999">None</span> <span style="color:#000;font-weight:bold">and</span> <span style="color:#0086b3">len</span>(month_names) <span style="color:#000;font-weight:bold">!=</span> <span style="color:#099">12</span>:
        sg<span style="color:#000;font-weight:bold">.</span>popup_error(<span style="color:#d14">&#39;Incorrect month names list specified. Must have 12 entries.&#39;</span>, <span style="color:#d14">&#39;Your list:&#39;</span>, month_names)

    <span style="color:#000;font-weight:bold">if</span> day_abbreviations <span style="color:#000;font-weight:bold">is</span> <span style="color:#000;font-weight:bold">not</span> <span style="color:#999">None</span> <span style="color:#000;font-weight:bold">and</span> <span style="color:#0086b3">len</span>(day_abbreviations) <span style="color:#000;font-weight:bold">!=</span> <span style="color:#099">7</span>:
        sg<span style="color:#000;font-weight:bold">.</span>popup_error(<span style="color:#d14">&#39;Incorrect day abbreviation list. Must have 7 entries.&#39;</span>, <span style="color:#d14">&#39;Your list:&#39;</span>, day_abbreviations)

    day_font <span style="color:#000;font-weight:bold">=</span> <span style="color:#d14">&#39;TkFixedFont 9&#39;</span>
    mon_year_font <span style="color:#000;font-weight:bold">=</span> <span style="color:#d14">&#39;TkFixedFont 10&#39;</span>
    arrow_font <span style="color:#000;font-weight:bold">=</span> <span style="color:#d14">&#39;TkFixedFont 7&#39;</span>

    now <span style="color:#000;font-weight:bold">=</span> datetime<span style="color:#000;font-weight:bold">.</span>datetime<span style="color:#000;font-weight:bold">.</span>now()
    cur_month, cur_day, cur_year <span style="color:#000;font-weight:bold">=</span> now<span style="color:#000;font-weight:bold">.</span>month, now<span style="color:#000;font-weight:bold">.</span>day, now<span style="color:#000;font-weight:bold">.</span>year
    cur_month <span style="color:#000;font-weight:bold">=</span> start_mon <span style="color:#000;font-weight:bold">or</span> cur_month
    <span style="color:#000;font-weight:bold">if</span> start_mon <span style="color:#000;font-weight:bold">is</span> <span style="color:#000;font-weight:bold">not</span> <span style="color:#999">None</span>:
        cur_day <span style="color:#000;font-weight:bold">=</span> start_day
    <span style="color:#000;font-weight:bold">else</span>:
        cur_day <span style="color:#000;font-weight:bold">=</span> cur_day
    cur_year <span style="color:#000;font-weight:bold">=</span> start_year <span style="color:#000;font-weight:bold">or</span> cur_year


    <span style="color:#000;font-weight:bold">def</span> <span style="color:#900;font-weight:bold">update_days</span>(window, month, year, begin_at_sunday_plus):
        [window[(week, day)]<span style="color:#000;font-weight:bold">.</span>update(<span style="color:#d14">&#39;&#39;</span>) <span style="color:#000;font-weight:bold">for</span> day <span style="color:#000;font-weight:bold">in</span> <span style="color:#0086b3">range</span>(<span style="color:#099">7</span>) <span style="color:#000;font-weight:bold">for</span> week <span style="color:#000;font-weight:bold">in</span> <span style="color:#0086b3">range</span>(<span style="color:#099">6</span>)]
        weeks <span style="color:#000;font-weight:bold">=</span> calendar<span style="color:#000;font-weight:bold">.</span>monthcalendar(year, month)
        month_days <span style="color:#000;font-weight:bold">=</span> <span style="color:#0086b3">list</span>(itertools<span style="color:#000;font-weight:bold">.</span>chain<span style="color:#000;font-weight:bold">.</span>from_iterable([[<span style="color:#099">0</span> <span style="color:#000;font-weight:bold">for</span> _ <span style="color:#000;font-weight:bold">in</span> <span style="color:#0086b3">range</span>(<span style="color:#099">8</span> <span style="color:#000;font-weight:bold">-</span> begin_at_sunday_plus)]] <span style="color:#000;font-weight:bold">+</span> weeks))
        <span style="color:#000;font-weight:bold">if</span> month_days[<span style="color:#099">6</span>] <span style="color:#000;font-weight:bold">==</span> <span style="color:#099">0</span>:
            month_days <span style="color:#000;font-weight:bold">=</span> month_days[<span style="color:#099">7</span>:]
            <span style="color:#000;font-weight:bold">if</span> month_days[<span style="color:#099">6</span>] <span style="color:#000;font-weight:bold">==</span> <span style="color:#099">0</span>:
                month_days <span style="color:#000;font-weight:bold">=</span> month_days[<span style="color:#099">7</span>:]
        <span style="color:#000;font-weight:bold">for</span> i, day <span style="color:#000;font-weight:bold">in</span> <span style="color:#0086b3">enumerate</span>(month_days):
            offset <span style="color:#000;font-weight:bold">=</span> i
            <span style="color:#000;font-weight:bold">if</span> offset <span style="color:#000;font-weight:bold">&gt;=</span> <span style="color:#099">6</span> <span style="color:#000;font-weight:bold">*</span> <span style="color:#099">7</span>:
                <span style="color:#000;font-weight:bold">break</span>
            window[(offset <span style="color:#000;font-weight:bold">//</span> <span style="color:#099">7</span>, offset <span style="color:#000;font-weight:bold">%</span> <span style="color:#099">7</span>)]<span style="color:#000;font-weight:bold">.</span>update(<span style="color:#0086b3">str</span>(day) <span style="color:#000;font-weight:bold">if</span> day <span style="color:#000;font-weight:bold">else</span> <span style="color:#d14">&#39;&#39;</span>)

    <span style="color:#000;font-weight:bold">def</span> <span style="color:#900;font-weight:bold">make_days_layout</span>():
        days_layout <span style="color:#000;font-weight:bold">=</span> []
        <span style="color:#000;font-weight:bold">for</span> week <span style="color:#000;font-weight:bold">in</span> <span style="color:#0086b3">range</span>(<span style="color:#099">6</span>):
            row <span style="color:#000;font-weight:bold">=</span> []
            <span style="color:#000;font-weight:bold">for</span> day <span style="color:#000;font-weight:bold">in</span> <span style="color:#0086b3">range</span>(<span style="color:#099">7</span>):
                row<span style="color:#000;font-weight:bold">.</span>append(sg<span style="color:#000;font-weight:bold">.</span>T(<span style="color:#d14">&#39;&#39;</span>, size<span style="color:#000;font-weight:bold">=</span>(<span style="color:#099">4</span>, <span style="color:#099">1</span>), justification<span style="color:#000;font-weight:bold">=</span><span style="color:#d14">&#39;c&#39;</span>, font<span style="color:#000;font-weight:bold">=</span>day_font, key<span style="color:#000;font-weight:bold">=</span>(week, day), enable_events<span style="color:#000;font-weight:bold">=</span><span style="color:#999">True</span>, pad<span style="color:#000;font-weight:bold">=</span>(<span style="color:#099">0</span>, <span style="color:#099">0</span>)))
            days_layout<span style="color:#000;font-weight:bold">.</span>append(row)
        <span style="color:#000;font-weight:bold">return</span> days_layout


    <span style="color:#998;font-style:italic"># Create table of month names and week day abbreviations</span>

    <span style="color:#000;font-weight:bold">if</span> day_abbreviations <span style="color:#000;font-weight:bold">is</span> <span style="color:#999">None</span> <span style="color:#000;font-weight:bold">or</span> <span style="color:#0086b3">len</span>(day_abbreviations) <span style="color:#000;font-weight:bold">!=</span> <span style="color:#099">7</span>:
        fwday <span style="color:#000;font-weight:bold">=</span> calendar<span style="color:#000;font-weight:bold">.</span>SUNDAY
        <span style="color:#000;font-weight:bold">try</span>:
            <span style="color:#000;font-weight:bold">if</span> locale <span style="color:#000;font-weight:bold">is</span> <span style="color:#000;font-weight:bold">not</span> <span style="color:#999">None</span>:
                _cal <span style="color:#000;font-weight:bold">=</span> calendar<span style="color:#000;font-weight:bold">.</span>LocaleTextCalendar(fwday, locale)
            <span style="color:#000;font-weight:bold">else</span>:
                _cal <span style="color:#000;font-weight:bold">=</span> calendar<span style="color:#000;font-weight:bold">.</span>TextCalendar(fwday)
            day_names <span style="color:#000;font-weight:bold">=</span> _cal<span style="color:#000;font-weight:bold">.</span>formatweekheader(<span style="color:#099">3</span>)<span style="color:#000;font-weight:bold">.</span>split()
        <span style="color:#000;font-weight:bold">except</span> <span style="color:#900;font-weight:bold">Exception</span> <span style="color:#000;font-weight:bold">as</span> e:
            <span style="color:#000;font-weight:bold">print</span>(<span style="color:#d14">&#39;Exception building day names from locale&#39;</span>, locale,  e)
            day_names <span style="color:#000;font-weight:bold">=</span> (<span style="color:#d14">&#39;Sun&#39;</span>, <span style="color:#d14">&#39;Mon&#39;</span>, <span style="color:#d14">&#39;Tue&#39;</span>, <span style="color:#d14">&#39;Wed&#39;</span>, <span style="color:#d14">&#39;Th&#39;</span>, <span style="color:#d14">&#39;Fri&#39;</span>, <span style="color:#d14">&#39;Sat&#39;</span>)
    <span style="color:#000;font-weight:bold">else</span>:
        day_names <span style="color:#000;font-weight:bold">=</span> day_abbreviations

    mon_names <span style="color:#000;font-weight:bold">=</span> month_names <span style="color:#000;font-weight:bold">if</span> month_names <span style="color:#000;font-weight:bold">is</span> <span style="color:#000;font-weight:bold">not</span> <span style="color:#999">None</span> <span style="color:#000;font-weight:bold">and</span> <span style="color:#0086b3">len</span>(month_names) <span style="color:#000;font-weight:bold">==</span> <span style="color:#099">12</span>  <span style="color:#000;font-weight:bold">else</span> [calendar<span style="color:#000;font-weight:bold">.</span>month_name[i] <span style="color:#000;font-weight:bold">for</span> i <span style="color:#000;font-weight:bold">in</span> <span style="color:#0086b3">range</span>(<span style="color:#099">1</span>,<span style="color:#099">13</span>)]
    days_layout <span style="color:#000;font-weight:bold">=</span> make_days_layout()

    layout <span style="color:#000;font-weight:bold">=</span> [[sg<span style="color:#000;font-weight:bold">.</span>B(<span style="color:#d14">&#39;◄◄&#39;</span>, font<span style="color:#000;font-weight:bold">=</span>arrow_font, border_width<span style="color:#000;font-weight:bold">=</span><span style="color:#099">0</span>, key<span style="color:#000;font-weight:bold">=</span><span style="color:#d14">&#39;-YEAR-DOWN-&#39;</span>, pad<span style="color:#000;font-weight:bold">=</span>((<span style="color:#099">10</span>,<span style="color:#099">2</span>),<span style="color:#099">2</span>)),
                sg<span style="color:#000;font-weight:bold">.</span>B(<span style="color:#d14">&#39;◄&#39;</span>, font<span style="color:#000;font-weight:bold">=</span>arrow_font, border_width<span style="color:#000;font-weight:bold">=</span><span style="color:#099">0</span>, key<span style="color:#000;font-weight:bold">=</span><span style="color:#d14">&#39;-MON-DOWN-&#39;</span>, pad<span style="color:#000;font-weight:bold">=</span>(<span style="color:#099">0</span>,<span style="color:#099">2</span>)),
               sg<span style="color:#000;font-weight:bold">.</span>Text(<span style="color:#d14">&#39;{} {}&#39;</span><span style="color:#000;font-weight:bold">.</span>format(mon_names[cur_month <span style="color:#000;font-weight:bold">-</span> <span style="color:#099">1</span>], cur_year), size<span style="color:#000;font-weight:bold">=</span>(<span style="color:#099">16</span>, <span style="color:#099">1</span>), justification<span style="color:#000;font-weight:bold">=</span><span style="color:#d14">&#39;c&#39;</span>, font<span style="color:#000;font-weight:bold">=</span>mon_year_font, key<span style="color:#000;font-weight:bold">=</span><span style="color:#d14">&#39;-MON-YEAR-&#39;</span>, pad<span style="color:#000;font-weight:bold">=</span>(<span style="color:#099">0</span>,<span style="color:#099">2</span>)),
               sg<span style="color:#000;font-weight:bold">.</span>B(<span style="color:#d14">&#39;►&#39;</span>, font<span style="color:#000;font-weight:bold">=</span>arrow_font,border_width<span style="color:#000;font-weight:bold">=</span><span style="color:#099">0</span>, key<span style="color:#000;font-weight:bold">=</span><span style="color:#d14">&#39;-MON-UP-&#39;</span>, pad<span style="color:#000;font-weight:bold">=</span>(<span style="color:#099">0</span>,<span style="color:#099">2</span>)),
               sg<span style="color:#000;font-weight:bold">.</span>B(<span style="color:#d14">&#39;►►&#39;</span>, font<span style="color:#000;font-weight:bold">=</span>arrow_font,border_width<span style="color:#000;font-weight:bold">=</span><span style="color:#099">0</span>, key<span style="color:#000;font-weight:bold">=</span><span style="color:#d14">&#39;-YEAR-UP-&#39;</span>, pad<span style="color:#000;font-weight:bold">=</span>(<span style="color:#099">2</span>,<span style="color:#099">2</span>))]]
    layout <span style="color:#000;font-weight:bold">+=</span> [[sg<span style="color:#000;font-weight:bold">.</span>Col([[sg<span style="color:#000;font-weight:bold">.</span>T(day_names[i <span style="color:#000;font-weight:bold">-</span> (<span style="color:#099">7</span> <span style="color:#000;font-weight:bold">-</span> begin_at_sunday_plus) <span style="color:#000;font-weight:bold">%</span> <span style="color:#099">7</span>], size<span style="color:#000;font-weight:bold">=</span>(<span style="color:#099">4</span>,<span style="color:#099">1</span>), font<span style="color:#000;font-weight:bold">=</span>day_font, background_color<span style="color:#000;font-weight:bold">=</span>sg<span style="color:#000;font-weight:bold">.</span>theme_text_color(), text_color<span style="color:#000;font-weight:bold">=</span>sg<span style="color:#000;font-weight:bold">.</span>theme_background_color(), pad<span style="color:#000;font-weight:bold">=</span>(<span style="color:#099">0</span>,<span style="color:#099">0</span>)) <span style="color:#000;font-weight:bold">for</span> i <span style="color:#000;font-weight:bold">in</span> <span style="color:#0086b3">range</span>(<span style="color:#099">7</span>)]], background_color<span style="color:#000;font-weight:bold">=</span>sg<span style="color:#000;font-weight:bold">.</span>theme_text_color(), pad<span style="color:#000;font-weight:bold">=</span>(<span style="color:#099">0</span>,<span style="color:#099">0</span>))]]
    layout <span style="color:#000;font-weight:bold">+=</span> days_layout
    <span style="color:#000;font-weight:bold">if</span> <span style="color:#000;font-weight:bold">not</span> close_when_chosen:
        layout <span style="color:#000;font-weight:bold">+=</span> [[sg<span style="color:#000;font-weight:bold">.</span>Button(<span style="color:#d14">&#39;Ok&#39;</span>, border_width<span style="color:#000;font-weight:bold">=</span><span style="color:#099">0</span>,font<span style="color:#000;font-weight:bold">=</span><span style="color:#d14">&#39;TkFixedFont 8&#39;</span>), sg<span style="color:#000;font-weight:bold">.</span>Button(<span style="color:#d14">&#39;Cancel&#39;</span>,border_width<span style="color:#000;font-weight:bold">=</span><span style="color:#099">0</span>, font<span style="color:#000;font-weight:bold">=</span><span style="color:#d14">&#39;TkFixedFont 8&#39;</span>)]]

    window <span style="color:#000;font-weight:bold">=</span> sg<span style="color:#000;font-weight:bold">.</span>Window(title, layout, no_titlebar<span style="color:#000;font-weight:bold">=</span>no_titlebar, grab_anywhere<span style="color:#000;font-weight:bold">=</span><span style="color:#999">True</span>, keep_on_top<span style="color:#000;font-weight:bold">=</span>keep_on_top, font<span style="color:#000;font-weight:bold">=</span><span style="color:#d14">&#39;TkFixedFont 12&#39;</span>, use_default_focus<span style="color:#000;font-weight:bold">=</span><span style="color:#999">False</span>, location<span style="color:#000;font-weight:bold">=</span>location, finalize<span style="color:#000;font-weight:bold">=</span><span style="color:#999">True</span>, icon<span style="color:#000;font-weight:bold">=</span>icon)

    update_days(window, cur_month, cur_year, begin_at_sunday_plus)

    prev_choice <span style="color:#000;font-weight:bold">=</span> chosen_mon_day_year <span style="color:#000;font-weight:bold">=</span> <span style="color:#999">None</span>

    <span style="color:#000;font-weight:bold">if</span> cur_day:
        chosen_mon_day_year <span style="color:#000;font-weight:bold">=</span> cur_month, cur_day, cur_year
        <span style="color:#000;font-weight:bold">for</span> week <span style="color:#000;font-weight:bold">in</span> <span style="color:#0086b3">range</span>(<span style="color:#099">6</span>):
            <span style="color:#000;font-weight:bold">for</span> day <span style="color:#000;font-weight:bold">in</span> <span style="color:#0086b3">range</span>(<span style="color:#099">7</span>):
                <span style="color:#000;font-weight:bold">if</span> window[(week,day)]<span style="color:#000;font-weight:bold">.</span>DisplayText <span style="color:#000;font-weight:bold">==</span> <span style="color:#0086b3">str</span>(cur_day):
                    window[(week,day)]<span style="color:#000;font-weight:bold">.</span>update(background_color<span style="color:#000;font-weight:bold">=</span>sg<span style="color:#000;font-weight:bold">.</span>theme_text_color(), text_color<span style="color:#000;font-weight:bold">=</span>sg<span style="color:#000;font-weight:bold">.</span>theme_background_color())
                    prev_choice <span style="color:#000;font-weight:bold">=</span> (week,day)
                    <span style="color:#000;font-weight:bold">break</span>

    <span style="color:#000;font-weight:bold">while</span> <span style="color:#999">True</span>:             <span style="color:#998;font-style:italic"># Event Loop</span>
        event, values <span style="color:#000;font-weight:bold">=</span> window<span style="color:#000;font-weight:bold">.</span>read()
        <span style="color:#000;font-weight:bold">if</span> event <span style="color:#000;font-weight:bold">in</span> (sg<span style="color:#000;font-weight:bold">.</span>WIN_CLOSED, <span style="color:#d14">&#39;Cancel&#39;</span>):
            chosen_mon_day_year <span style="color:#000;font-weight:bold">=</span> <span style="color:#999">None</span>
            <span style="color:#000;font-weight:bold">break</span>
        <span style="color:#000;font-weight:bold">if</span> event <span style="color:#000;font-weight:bold">==</span> <span style="color:#d14">&#39;Ok&#39;</span>:
            <span style="color:#000;font-weight:bold">break</span>
        <span style="color:#000;font-weight:bold">if</span> event <span style="color:#000;font-weight:bold">in</span> (<span style="color:#d14">&#39;-MON-UP-&#39;</span>, <span style="color:#d14">&#39;-MON-DOWN-&#39;</span>, <span style="color:#d14">&#39;-YEAR-UP-&#39;</span>,<span style="color:#d14">&#39;-YEAR-DOWN-&#39;</span>):
            cur_month <span style="color:#000;font-weight:bold">+=</span> (event <span style="color:#000;font-weight:bold">==</span> <span style="color:#d14">&#39;-MON-UP-&#39;</span>)
            cur_month <span style="color:#000;font-weight:bold">-=</span> (event <span style="color:#000;font-weight:bold">==</span> <span style="color:#d14">&#39;-MON-DOWN-&#39;</span>)
            cur_year <span style="color:#000;font-weight:bold">+=</span> (event <span style="color:#000;font-weight:bold">==</span> <span style="color:#d14">&#39;-YEAR-UP-&#39;</span>)
            cur_year <span style="color:#000;font-weight:bold">-=</span> (event <span style="color:#000;font-weight:bold">==</span> <span style="color:#d14">&#39;-YEAR-DOWN-&#39;</span>)
            <span style="color:#000;font-weight:bold">if</span> cur_month <span style="color:#000;font-weight:bold">&gt;</span> <span style="color:#099">12</span>:
                cur_month <span style="color:#000;font-weight:bold">=</span> <span style="color:#099">1</span>
                cur_year <span style="color:#000;font-weight:bold">+=</span> <span style="color:#099">1</span>
            <span style="color:#000;font-weight:bold">elif</span> cur_month <span style="color:#000;font-weight:bold">&lt;</span> <span style="color:#099">1</span>:
                cur_month <span style="color:#000;font-weight:bold">=</span> <span style="color:#099">12</span>
                cur_year <span style="color:#000;font-weight:bold">-=</span> <span style="color:#099">1</span>
            window[<span style="color:#d14">&#39;-MON-YEAR-&#39;</span>]<span style="color:#000;font-weight:bold">.</span>update(<span style="color:#d14">&#39;{} {}&#39;</span><span style="color:#000;font-weight:bold">.</span>format(mon_names[cur_month <span style="color:#000;font-weight:bold">-</span> <span style="color:#099">1</span>], cur_year))
            update_days(window, cur_month, cur_year, begin_at_sunday_plus)
            <span style="color:#000;font-weight:bold">if</span> prev_choice:
                window[prev_choice]<span style="color:#000;font-weight:bold">.</span>update(background_color<span style="color:#000;font-weight:bold">=</span>sg<span style="color:#000;font-weight:bold">.</span>theme_background_color(), text_color<span style="color:#000;font-weight:bold">=</span>sg<span style="color:#000;font-weight:bold">.</span>theme_text_color())
        <span style="color:#000;font-weight:bold">elif</span> <span style="color:#0086b3">type</span>(event) <span style="color:#000;font-weight:bold">is</span> <span style="color:#0086b3">tuple</span>:
            <span style="color:#000;font-weight:bold">if</span> window[event]<span style="color:#000;font-weight:bold">.</span>DisplayText <span style="color:#000;font-weight:bold">!=</span> <span style="color:#d14">&#34;&#34;</span>:
                chosen_mon_day_year <span style="color:#000;font-weight:bold">=</span> cur_month, <span style="color:#0086b3">int</span>(window[event]<span style="color:#000;font-weight:bold">.</span>DisplayText), cur_year
                <span style="color:#000;font-weight:bold">if</span> prev_choice:
                    window[prev_choice]<span style="color:#000;font-weight:bold">.</span>update(background_color<span style="color:#000;font-weight:bold">=</span>sg<span style="color:#000;font-weight:bold">.</span>theme_background_color(), text_color<span style="color:#000;font-weight:bold">=</span>sg<span style="color:#000;font-weight:bold">.</span>theme_text_color())
                window[event]<span style="color:#000;font-weight:bold">.</span>update(background_color<span style="color:#000;font-weight:bold">=</span>sg<span style="color:#000;font-weight:bold">.</span>theme_text_color(), text_color<span style="color:#000;font-weight:bold">=</span>sg<span style="color:#000;font-weight:bold">.</span>theme_background_color())
                prev_choice <span style="color:#000;font-weight:bold">=</span> event
                <span style="color:#000;font-weight:bold">if</span> close_when_chosen:
                    <span style="color:#000;font-weight:bold">break</span>
    window<span style="color:#000;font-weight:bold">.</span>close()
    <span style="color:#000;font-weight:bold">return</span> chosen_mon_day_year


<span style="color:#000;font-weight:bold">print</span>(popup_get_date())
</code></pre></td></tr></table>
</div>
</div><h2 id="收集这些按钮-写成自己的文档">收集这些按钮 写成自己的文档</h2>
<p>Frame</p>
<pre><code>   layout = [[sg.Frame('Nice Buttons', frame_layout, font=('any 18'), background_color='black')]]

</code></pre>
        </div>

        
<div class="post-archive">
    <ul class="post-copyright">
        <li><strong>原文作者：</strong><a rel="author" href="https://gwozai.gitee.io/">gwozai</a></li>
        <li style="word-break:break-all"><strong>原文链接：</strong><a href="https://gwozai.gitee.io/post/pysimplegui_calendar/">https://gwozai.gitee.io/post/pysimplegui_calendar/</a></li>
        <li><strong>版权声明：</strong>本作品采用<a rel="license" href="http://gwozai.giee.io">gwozai的个人博客</a>进行许可，非商业转载请注明出处（作者，原文链接），商业转载请联系作者获得授权。</li>
    </ul>
</div>
<br/>



        

<div class="post-archive">
    <h2>See Also</h2>
    <ul class="listing">
        
        <li><a href="/post/nohup/">Linux命令记录</a></li>
        
        <li><a href="/post/javascriptservletxml/">TODO</a></li>
        
        <li><a href="/post/redisnotes/">Redis事务</a></li>
        
        <li><a href="/post/weijiyuanlinotes/">汇编</a></li>
        
        <li><a href="/post/frprun/">git的安装</a></li>
        
    </ul>
</div>


        <div class="post-meta meta-tags">
            
            <ul class="clearfix">
                
                <li><a href='/tags/PySimpleGUi'>PySimpleGUi</a></li>
                
            </ul>
            
        </div>
    </article>
    
    <div id="disqus_thread"></div>
<script type="application/javascript">
    var disqus_config = function () {
    
    
    
    };
    (function() {
        if (["localhost", "127.0.0.1"].indexOf(window.location.hostname) != -1) {
            document.getElementById('disqus_thread').innerHTML = 'Disqus comments not available by default when the website is previewed locally.';
            return;
        }
        var d = document, s = d.createElement('script'); s.async = true;
        s.src = '//' + "yourdiscussshortname" + '.disqus.com/embed.js';
        s.setAttribute('data-timestamp', +new Date());
        (d.head || d.body).appendChild(s);
    })();
</script>
<noscript>Please enable JavaScript to view the <a href="https://disqus.com/?ref_noscript">comments powered by Disqus.</a></noscript>
<a href="https://disqus.com" class="dsq-brlink">comments powered by <span class="logo-disqus">Disqus</span></a>

    
    
    <div class="post bg-white">
      <script src="https://utteranc.es/client.js"
            repo= "ssazi/u"
            issue-term="pathname"
            theme="github-light"
            crossorigin="anonymous"
            async>
      </script>
    </div>
    
</div>

                    <footer id="footer">
    <div>
        &copy; 2022 <a href="https://gwozai.gitee.io/">Java专家随笔记 By gwozai</a>
        
        | <a rel="nofollow" target="_blank" href="http://www.beian.miit.gov.cn/">晋ICP备2020013641号-3</a>
        
    </div>
    <br />
    <div>
        <div class="github-badge">
            <a href="https://gohugo.io/" target="_black" rel="nofollow"><span class="badge-subject">Powered by</span><span class="badge-value bg-blue">Hugo</span></a>
        </div>
        <div class="github-badge">
            <a href="https://www.flysnow.org/" target="_black"><span class="badge-subject">Design by</span><span class="badge-value bg-brightgreen">飞雪无情</span></a>
        </div>
        <div class="github-badge">
            <a href="https://github.com/flysnow-org/maupassant-hugo" target="_black"><span class="badge-subject">Theme</span><span class="badge-value bg-yellowgreen">Maupassant</span></a>
        </div>
    </div>
</footer>


    
    <script type="text/javascript">
        window.MathJax = {
            tex2jax: {
                inlineMath: [['$', '$']],
                processEscapes: true
                }
            };
    </script>
    <script src='https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js?config=TeX-MML-AM_CHTML' async></script><script src="https://cdn.bootcdn.net/ajax/libs/fancybox/3.5.7/jquery.fancybox.min.js"></script>

<a id="rocket" href="#top"></a>
<script type="text/javascript" src='/js/totop.js?v=0.0.0' async=""></script>



    <script type="text/javascript" src="//busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js" async></script>




    <script src='/js/douban.js'></script>

                </div>

                <div id="secondary">
    <section class="widget">
        <form id="search" action='https://gwozai.gitee.io/search/' method="get" accept-charset="utf-8" target="_blank" _lpchecked="1">
      
      <input type="text" name="q" maxlength="20" placeholder="Search">
      <input type="hidden" name="sitesearch" value="https://gwozai.gitee.io/">
      <button type="submit" class="submit icon-search"></button>
</form>
    </section>
    
    <section class="widget">
        <h3 class="widget-title">最近文章</h3>
<ul class="widget-list">
    
    <li>
        <a href="https://gwozai.gitee.io/post/%E7%88%AC%E8%99%AB-1-IP%E4%BB%A3%E7%90%86%E6%B1%A0/" title="IP代理池">IP代理池</a>
    </li>
    
    <li>
        <a href="https://gwozai.gitee.io/post/java11/" title="centos 安装 java 11">centos 安装 java 11</a>
    </li>
    
    <li>
        <a href="https://gwozai.gitee.io/post/hitokoto/" title="一言的本地搭建">一言的本地搭建</a>
    </li>
    
    <li>
        <a href="https://gwozai.gitee.io/post/mail/" title="邮箱服务">邮箱服务</a>
    </li>
    
    <li>
        <a href="https://gwozai.gitee.io/post/sizhi/" title="聊天机器人">聊天机器人</a>
    </li>
    
    <li>
        <a href="https://gwozai.gitee.io/post/z/" title="minio">minio</a>
    </li>
    
    <li>
        <a href="https://gwozai.gitee.io/post/activeMQ/" title="github图床加速">github图床加速</a>
    </li>
    
    <li>
        <a href="https://gwozai.gitee.io/post/oneindex/" title="Oneindex">Oneindex</a>
    </li>
    
    <li>
        <a href="https://gwozai.gitee.io/post/dos/" title="dos命令">dos命令</a>
    </li>
    
    <li>
        <a href="https://gwozai.gitee.io/post/pycharm/" title="Pycharm">Pycharm</a>
    </li>
    
</ul>
    </section>

    
<section class="widget">
    <h3 class="widget-title" style="color:red">福利派送</h3>
    <ul class="widget-list">
        
        <li>
            <a href="https://www.aliyun.com/activity/1111?userCode=q8qrpnxv" title="精心挑选的热门优惠云产品，登录客户点击链接即成为您的关联客户购买最高可获31%返现。" target="_blank" style="color:red">
                
                    <img src="https://cdn.jsdelivr.net/gh/ssazi/img//img/img440-240%201.jpg">
                
            </a>
        </li>
        
        <li>
            <a href="https://s.qiniu.com/ui2uiy" title="爆款云产品全年最低价，热门产品 0 元秒杀，参与抽奖赢新款 iPhone" target="_blank" style="color:red">
                
                    <img src="https://cdn.jsdelivr.net/gh/ssazi/img/img/259X194.jpg">
                
            </a>
        </li>
        
        <li>
            <a href="https://curl.qcloud.com/FbfrTIg9" title="【腾讯云】爆款1核2G云服务器首年48元，还有iPad Pro、Bose耳机、京东卡等你来抽！https://cloud.tencent.com/act/cps/redirect?redirect=1575&amp;cps_key=84e8cfc536a354a142b3335df9b399aa&amp;from=console" target="_blank" style="color:red">
                
                    <img src="https://cdn.jsdelivr.net/gh/ssazi/img/img/345x200.jpg">
                
            </a>
        </li>
        
    </ul>
</section>


    <section class="widget">
        <h3 class="widget-title"><a href='/categories/'>分类</a></h3>
<ul class="widget-list">
    
    <li><a href="https://gwozai.gitee.io/categories/PySimpleGUi/">PySimpleGUi (1)</a></li>
    
    <li><a href="https://gwozai.gitee.io/categories/Redis/">Redis (1)</a></li>
    
    <li><a href="https://gwozai.gitee.io/categories/TODO/">TODO (1)</a></li>
    
    <li><a href="https://gwozai.gitee.io/categories/Vmware/">Vmware (1)</a></li>
    
    <li><a href="https://gwozai.gitee.io/categories/docker/">docker (1)</a></li>
    
    <li><a href="https://gwozai.gitee.io/categories/dos/">dos (1)</a></li>
    
    <li><a href="https://gwozai.gitee.io/categories/frp/">frp (1)</a></li>
    
    <li><a href="https://gwozai.gitee.io/categories/git/">git (1)</a></li>
    
    <li><a href="https://gwozai.gitee.io/categories/github/">github (2)</a></li>
    
    <li><a href="https://gwozai.gitee.io/categories/java/">java (1)</a></li>
    
    <li><a href="https://gwozai.gitee.io/categories/linux/">linux (1)</a></li>
    
    <li><a href="https://gwozai.gitee.io/categories/mail/">mail (1)</a></li>
    
    <li><a href="https://gwozai.gitee.io/categories/minio/">minio (2)</a></li>
    
    <li><a href="https://gwozai.gitee.io/categories/mysql/">mysql (2)</a></li>
    
    <li><a href="https://gwozai.gitee.io/categories/nginx/">nginx (1)</a></li>
    
    <li><a href="https://gwozai.gitee.io/categories/oss/">oss (2)</a></li>
    
    <li><a href="https://gwozai.gitee.io/categories/python/">python (1)</a></li>
    
    <li><a href="https://gwozai.gitee.io/categories/%E4%B8%80%E8%A8%80/">一言 (1)</a></li>
    
    <li><a href="https://gwozai.gitee.io/categories/%E5%8A%A0%E9%80%9F%E5%99%A8/">加速器 (3)</a></li>
    
    <li><a href="https://gwozai.gitee.io/categories/%E5%8D%9A%E5%AE%A2/">博客 (1)</a></li>
    
    <li><a href="https://gwozai.gitee.io/categories/%E6%95%B0%E6%8D%AE%E7%BB%93%E6%9E%84/">数据结构 (1)</a></li>
    
    <li><a href="https://gwozai.gitee.io/categories/%E6%9C%BA%E5%99%A8%E5%AD%A6%E4%B9%A0/">机器学习 (1)</a></li>
    
    <li><a href="https://gwozai.gitee.io/categories/%E6%9D%82%E8%AE%B0/">杂记 (1)</a></li>
    
    <li><a href="https://gwozai.gitee.io/categories/%E6%B1%87%E7%BC%96%E5%8E%9F%E7%90%86/">汇编原理 (1)</a></li>
    
    <li><a href="https://gwozai.gitee.io/categories/%E8%81%8A%E5%A4%A9%E6%9C%BA%E5%99%A8%E4%BA%BA/">聊天机器人 (1)</a></li>
    
</ul>
    </section>

    <section class="widget">
        <h3 class="widget-title"><a href='/tags/'>标签</a></h3>
<div class="tagcloud">
    
    <a href="https://gwozai.gitee.io/tags/PySimpleGUi/">PySimpleGUi</a>
    
    <a href="https://gwozai.gitee.io/tags/Redis/">Redis</a>
    
    <a href="https://gwozai.gitee.io/tags/TODO/">TODO</a>
    
    <a href="https://gwozai.gitee.io/tags/docker/">docker</a>
    
    <a href="https://gwozai.gitee.io/tags/dos/">dos</a>
    
    <a href="https://gwozai.gitee.io/tags/frp/">frp</a>
    
    <a href="https://gwozai.gitee.io/tags/git/">git</a>
    
    <a href="https://gwozai.gitee.io/tags/github/">github</a>
    
    <a href="https://gwozai.gitee.io/tags/java/">java</a>
    
    <a href="https://gwozai.gitee.io/tags/linux/">linux</a>
    
    <a href="https://gwozai.gitee.io/tags/mail/">mail</a>
    
    <a href="https://gwozai.gitee.io/tags/minio/">minio</a>
    
    <a href="https://gwozai.gitee.io/tags/mysql/">mysql</a>
    
    <a href="https://gwozai.gitee.io/tags/nginx/">nginx</a>
    
    <a href="https://gwozai.gitee.io/tags/python/">python</a>
    
    <a href="https://gwozai.gitee.io/tags/vmware/">vmware</a>
    
    <a href="https://gwozai.gitee.io/tags/%E4%B8%80%E8%A8%80/">一言</a>
    
    <a href="https://gwozai.gitee.io/tags/%E5%8A%A0%E9%80%9F%E5%99%A8/">加速器</a>
    
    <a href="https://gwozai.gitee.io/tags/%E5%8D%9A%E5%AE%A2/">博客</a>
    
    <a href="https://gwozai.gitee.io/tags/%E6%95%B0%E6%8D%AE%E7%BB%93%E6%9E%84/">数据结构</a>
    
    <a href="https://gwozai.gitee.io/tags/%E6%9C%BA%E5%99%A8%E5%AD%A6%E4%B9%A0/">机器学习</a>
    
    <a href="https://gwozai.gitee.io/tags/%E6%B1%87%E7%BC%96%E5%8E%9F%E7%90%86/">汇编原理</a>
    
    <a href="https://gwozai.gitee.io/tags/%E8%81%8A%E5%A4%A9%E6%9C%BA%E5%99%A8%E4%BA%BA/">聊天机器人</a>
    
</div>
    </section>

    
<section class="widget">
    <h3 class="widget-title">友情链接</h3>
    <ul class="widget-list">
        
        <li>
            <a target="_blank" href="http://zfile.gwozai.com" title="我的分享盘">我的分享盘</a>
        </li>
        
        <li>
            <a target="_blank" href="https://www.cnblogs.com/gwozai/" title="博客园">博客园</a>
        </li>
        
        <li>
            <a target="_blank" href="http://note.gwozai.com" title="在线记事本">在线记事本</a>
        </li>
        
    </ul>
</section>


    <section class="widget">
        <h3 class="widget-title">其它</h3>
        <ul class="widget-list">
            <li><a href="https://gwozai.gitee.io/index.xml">文章 RSS</a></li>
        </ul>
    </section>
</div>
            </div>
        </div>
    </div>
</body>

</html>